package fl.ass.service.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cmm.service.core.framework.biz.BaseBizImpl;
import cmm.service.core.framework.dao.IBaseDao;
import cn.cmm.base.framework.exception.BaseException;
import fl.ass.facade.condition.AssTrailCarDInfQueryCondition;
import fl.ass.facade.dto.AssTrailCarDInfDTO;
import fl.ass.service.dao.AssTrailCarDInfMapper;
import fl.ass.service.po.AssTrailCarDInf;
import fl.ass.service.service.IAssTrailCarDInfService;
import fl.ass.service.transform.AssTrailCarDInfTransform;

/**
 * @Description: 拖车实际信息明细表 服务层接口实现
 * @Description: 类中已经实现了简单增删改查操作,可以直接使用,如果有需要重写该方法即可：
 * @Description: 1、add(TVO entity) 2、removeById(Long id) 3、modify(DTO entity) 4、selectById(Long id)	5、searchListPage(Pager page) 7、searchList(DTO dto)   
 * @Description: 业务层方法名称前缀：新增：add* 删除：remove* 修改：modify* 查询对象：select* get* 批量：batch* 查询集合：search*
 */
@Service
public class AssTrailCarDInfServiceImpl extends BaseBizImpl<AssTrailCarDInf, AssTrailCarDInfDTO, AssTrailCarDInfQueryCondition> implements IAssTrailCarDInfService {
	
	@SuppressWarnings("unused")
	private static final Logger logger = LoggerFactory.getLogger(IAssTrailCarDInfService.class);
	
	@Autowired
	private AssTrailCarDInfMapper assTrailCarDInfMapper;
	
	@Override
	public List<AssTrailCarDInfDTO> searchList(AssTrailCarDInfQueryCondition condition) throws BaseException {
		if(null == condition) return new ArrayList<AssTrailCarDInfDTO>();
		List<AssTrailCarDInf> list = this.assTrailCarDInfMapper.selectList(condition);
		return AssTrailCarDInfTransform.toDTOList(list);
	}
	
	@Override
	public IBaseDao<AssTrailCarDInf,AssTrailCarDInfQueryCondition> getDao() {
		return this.assTrailCarDInfMapper;
	}

	@Override
	public List<AssTrailCarDInfDTO> findPayInfoListByPaySchIds(List<Long> paySchIds) {
		return assTrailCarDInfMapper.findPayInfoListByPaySchIds(paySchIds);
	}

	/**
	 * 根据业务主键查询流程号和支付表号
	 */
	@Override
	public AssTrailCarDInfDTO selectPNoPaySchNoByDataId(Long dataId) throws BaseException {
		return assTrailCarDInfMapper.findPNoPaySchNoByDataId(dataId);
	}
	
}

